Skip to content

feat(predict): use PredictPositionDetail in picks for extended sports markets#28696

Open
caieu wants to merge 3 commits intomainfrom
predict/PRED-803-phase-3-positions-tab-all-market-type-positions
Open

feat(predict): use PredictPositionDetail in picks for extended sports markets#28696
caieu wants to merge 3 commits intomainfrom
predict/PRED-803-phase-3-positions-tab-all-market-type-positions

Conversation

@caieu
Copy link
Copy Markdown
Contributor

@caieu caieu commented Apr 10, 2026

Description

The Predict Picks section (used in game details) currently renders PredictPickItem — a simple row showing "Picked [outcome] at $X" with PnL. For sports markets with extended market types (spreads, totals, player props), we need the richer PredictPositionDetail component that already exists on the regular market details screen, which includes icons, real-time preview values, percentage PnL, privacy mode support, and a full-width cash-out button.

This PR conditionally renders PredictPositionDetail instead of PredictPickItem inside PredictPicks when the market's league is in the extendedSportsMarketsLeagues feature flag — following the same flag pattern used by useGameDetailsTabs. When the flag is disabled (or the market has no game/league), the existing PredictPickItem rendering is preserved.

Also includes a minor cleanup: removes an unnecessary useEffect in useGameDetailsTabs that was resetting activeTab when tabs changed.

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/PRED-803

Manual testing steps

Feature: PredictPositionDetail in sports prediction picks

  Scenario: user views positions for an extended sports market
    Given the user has open positions on a sports market with a league in extendedSportsMarketsLeagues (e.g. NBA)

    When user navigates to the game details screen
    Then positions are displayed using the rich PredictPositionDetail component
    And each position shows an icon, title, shares info, real-time current value, and percentage PnL
    And each open position has a full-width "Cash out" button

  Scenario: user views positions for a non-extended sports market
    Given the user has open positions on a sports market whose league is NOT in extendedSportsMarketsLeagues

    When user navigates to the game details screen
    Then positions are displayed using the original PredictPickItem component
    And each position shows "Picked [outcome] at $X" format with PnL value

  Scenario: user views positions for a non-sports market
    Given the user has open positions on a non-sports prediction market (no game property)

    When user navigates to the market details screen
    Then positions are displayed using the original PredictPickItem component

Screenshots/Recordings

Before

tabsafter.mp4

After

positionsafter.mp4

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Changes conditional rendering for the Picks list and adjusts tab state behavior; also removes polling on active positions, which could affect UI freshness and user interaction flows in game details.

Overview
Game details picks rendering is upgraded for extended sports markets. PredictPicks now checks selectExtendedSportsMarketsLeagues and, when the market’s game.league is enabled, renders PredictPositionDetail (including forcing CLOSED status for claimable positions) instead of PredictPickItem.

Behavioral tweaks and coverage. useGameDetailsTabs no longer resets activeTab when the tab set changes, tests were updated/added for the new picks rendering and tab behavior, and PredictGameDetailsContent stops polling active positions by removing the refetchInterval option.

Reviewed by Cursor Bugbot for commit f8c9faa. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-predict Predict team label Apr 10, 2026
@caieu caieu marked this pull request as ready for review April 10, 2026 23:03
@caieu caieu requested a review from a team as a code owner April 10, 2026 23:03
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - draft PR

All E2E tests pre-selected.

View GitHub Actions results

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f8c9faa. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants